package com.zhoushihao.class0815;

import java.math.BigInteger;
import java.util.Scanner;

public class Gun {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        BigInteger bigInteger = new BigInteger(String.valueOf(n));
        BigInteger num= new BigInteger("1");
        int count = 1;
        while(!num.mod(bigInteger).equals(BigInteger.ZERO)){
            num = num.multiply(BigInteger.TEN).add(BigInteger.ONE);
            count++;
        }
        System.out.println(num.divide(bigInteger) + " " + count);
    }
}
